﻿using PoliticalClassifier.Support;

namespace PoliticalClassifier.DataSource
{
    /// <summary>
    /// Provides a base class for all data source warnings.
    /// </summary>
    internal abstract class DataSourceWarningBase : IDataSourceLoadWarning
    {
        #region Construction
        /// <summary>
        /// Constructs a data source warning of the given type.
        /// </summary>
        /// <param name="warningType">The type of warning.</param>
        protected DataSourceWarningBase(DataSourceLoadWarningType warningType)
        {
            WarningType = warningType;
        }
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets the type of warning.
        /// </summary>
        public DataSourceLoadWarningType WarningType { get; private set; }
        #endregion

        #region Public Methods
        /// <summary>
        /// Gets a human readable warning message.
        /// </summary>
        /// <returns>A human readable warning message.</returns>
        public abstract string GetWarningMessage();


        /// <summary>
        /// Overrides System.Object.ToString() to return a human readable warning message.
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return GetWarningMessage();
        }
        #endregion
    }
}
